Ext.define('TS.view.dilema.RateGrid' , {
	extend: 'TS.lib.Grid',
	alias : 'widget.dilemapointrategrid',
	tbar:[
		Factory.btn.ico('search',Factory.toolbar._.go,{
			fix:'dilemapointrategrid',
			flds:{
				hidden:['argument']
			}
		}),
		
		{xtype:'hidden',name:'argument',names:['dilema_point_rate.dilema_point_id'],getVal:function(){
			return Util.fldVal('dilema_point->id');
		}},
		
		Factory.btn.ico('add',
			function(){
				var fix = 'dilemapointrate';
				Factory.winForm(fix,null,'simple');
				
				Util.fldVal(fix+'->#dilema_point_id','dilema_point->id');
			}
		)
	
	],
	
	frame:false,
	store: 'DilemaPointRate',
	listeners:{
		'itemdblclick':function(){
			/* user data		
			'user_id',
			'dilema_point_rate_user_name',
			'dilema_point_rate_date',
			'dilema_point_rate_ip'
			*/
		}
	},
	columns: [
	 	{xtype: 'rownumberer'},{
			header:'ID',
			hidden:true,
			dataIndex:'dilema_point_rate_id'
		},{
			header:'Komentaż',
			dataIndex:'dilema_point_rate_comment',
			renderer:Factory.rend.div
		},{
			header:'Ocena',
			renderer:function(v,x,s){
				var ret = '', star = Ext.String.format('<img src="{0}"/>',URL.icon('13.png'));
				
				for(var i = 0; i<v;i++){
					ret+=star;
				}
				return ret;
			},
			dataIndex:'dilema_point_rate_value'
		}
	]
});